package com.hnx.admin.aurora.core;

import com.hnx.admin.aurora.annotation.Captcha;
import com.hnx.admin.aurora.api.sys.CaptchaLoginValidator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/*
创建人： 倔强的头发
创建时间：2025/7/5
功能描述:

*/
@Component
@RequiredArgsConstructor
public class CaptchaValidator implements ConstraintValidator<Captcha,Object> {
    private final CaptchaLoginValidator captchaLoginValidator;
    @Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
        return captchaLoginValidator.isValid(value,context);
    }
}
